#include"Common.h"


// thread cache本质上是由自由链表构成的哈希桶
class ThreadCache
{
public:
    // 申请内存对象
    void* Allocate(size_t size);

    // 从CentralCache中获取内存对象
    void* FetchFromCentralCache(size_t index, size_t size);

private:
    FreeList _freeLists[NFREELISTS];
} ;


// TLS-thread local storage 线程本地存储
// 线程通过TLS获取它专属的thread cache
static __thread ThreadCache* pTLSThreadCache = nullptr;